#include "STC15F2K60S2.H"
#include <intrins.h>
#include "MINE.H"

void InterruptTimer0()interrupt 1
{	
	TH0=(65536-200)/256;
	TL0=(65536-200)%256;	
	
	count++;
	if (count<500){
		led(0x1);
	}else if(count<1000){
		led(0x2);
	}else if(count<1500){
		led(0x4);
	}else if(count<2000){
		led(0x8);
	}else if(count<2500){
		led(0x10);
	}else if(count<3000){
		led(0x20);
	}else if(count<3500){
		led(0x40);
	}else if(count<4000){
		led(0x80);	
	}else if(count<9000){
		voice_maker(1);
	}else if(count<49000 && count%2==0){
		light_display(flag,number1/100,(number1/10)%10,number1%10,10,10,number2/100,(number2/10)%10,number2%10,number1/100,(number1/10)%10,number1%10,10,10,number2/100,(number2/10)%10,number2%10);
		flag++;	
		xiaodou_count();
	}else if(count<49000 && count%2!=0){
		//P0=0x00;
		//led_sel=1;
		if(count<14000){
			led(0x0);
		}else if(count<19000){
			led(0x1);
		}else if(count<24000){
			led(0x3);
		}else if(count<29000){
			led(0x7);
		}else if(count<34000){
			led(0x0f);
		}else if(count<39000){
			led(0x1f);
		}else if(count<44000){
			led(0x3f);
		}else if(count<49000){
			led(0x7f);
		}else{
			led(0xff);
		}
	}else if(count<54000){
		led(0xff);
		voice_maker(2);
	}else{
		end();
	}	
}

void main()
{
	Init();
	while(1)
	{
		if(flag==16){//修正位选位置  可放在中断程序外 放在中断外 效果更好
			flag=0;
		}
		
		xiaodou_done(30,20,30,20);
	}
}